package com.heima.wemedia.thread;

import com.heima.model.wemedia.pojos.WmUser;

/**
 * @author lzy
 * @date 2022/7/16 18:16
 */
public class UserThreadLocal {

    //ThreadLocal类型的静态变量
    private static ThreadLocal<WmUser> userThreadLocal = new ThreadLocal<>();

    //变量对应的get和set方法
    public static WmUser get(){
        return userThreadLocal.get();
    }

    public static void set(WmUser wmUser){
        userThreadLocal.set(wmUser);
    }
    //变量对于的remove方法
    public static void remove(){
        userThreadLocal.remove();
    }
}
